<script setup>
// ref:获取原生标签dom  获取组件实例this   定义响应式数据

import { onMounted, ref } from 'vue'

/*
获取原生标签dom
 1：定义一个空的响应式数据
    const xxx=ref(不传值/undefined/null)
 2:在原生标签上绑定ref  ref=定义的xxx
     <div ref='xxx'>123</div>
 3:获取dom(就是访问xxx的值),一定要dom渲染后获取
    xxx.value    
*/
const divDom = ref()
onMounted(() => {
  console.log(divDom.value)
})
</script>

<template>
  <div class="app-page" ref="divDom">app</div>
</template>

<style scoped></style>
